<!DOCTYPE html>
<html>
<head>
    <title>数据字典管理</title>
    <meta charset="utf-8">
    <%- include ../default.html%>
    <link href="/public/css/main.css" rel="stylesheet" type="text/css"/>
    <link href="/public/css/user-manage.css" rel="stylesheet" type="text/css"/>
</head>

<body>
    <%- include header.html%>
    <section>
        <%- include menu.html%>
        <aside class="content" id="content">
            <el-form :inline="false" v-model="classForm" class="demo-form-inline api-user query-api">
                <el-row :gutter="2">
                    <el-col :sm="8" :md="6" :lg="4">
                        <el-form-item label="类别">
                            <el-input v-model="classForm.type" placeholder="请输入类别" size="mini"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col  :sm="8" :md="8" :lg="4">
                        <el-form-item>
                            <el-button type="primary" @click="searchList" size="mini" style="padding:7px 10px;">查询</el-button>
                            <el-button type="danger" @click="batchDelete" size="mini" style="padding:7px 10px;">批量删除</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <template>
                <el-table :data="tableData" style="width: 100%" size="mini" class="aa-table"  @select-all="selectAll"  @select="selectRow" :highlight-current-row="highlight">
                    <el-table-column fixed type="selection" label="" width="50"></el-table-column>
                    <el-table-column fixed type="index" label="序号" width="50"></el-table-column>
                    <el-table-column fixed prop="type" label="类型" width="120">
                        <template slot-scope="scope">
                            <el-input v-if="scope.row.edit == true"  v-model="scope.row.type" size="mini"></el-input>
                            <div v-else class="cell">{{scope.row.type}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column fixed prop="id" label="ID" width="200">
                        <template slot-scope="scope">
                            <el-input v-if="scope.row.edit == true"  v-model="scope.row.id" size="mini"></el-input>
                            <div v-else class="cell">{{scope.row.id}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column fixed prop="name"label="名称" width="120">
                        <template slot-scope="scope">
                            <el-input v-if="scope.row.edit == true"  v-model="scope.row.name" size="mini"></el-input>
                            <div v-else class="cell">{{scope.row.name}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column fixed prop="name"label="顺序号" width="120">
                        <template slot-scope="scope">
                            <el-input v-if="scope.row.edit == true"  v-model="scope.row.sxh" size="mini"></el-input>
                            <div v-else class="cell">{{scope.row.sxh}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column fixed prop="memo" class-name="edit memo"  label="备注" width="200">
                        <template slot-scope="scope">
                            <el-input v-if="scope.row.edit == true"  v-model="scope.row.memo" size="mini"></el-input>
                            <div v-else class="cell">{{scope.row.memo}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column  prop="operate" label="操作" :render-header="renderHeader"  align="center">
                        <template slot-scope="scope">
                            <el-button size="mini" @click="editHandler(scope.row,$event)">{{scope.row.edit == true ? "保存":"编辑"}}</el-button>
                            <el-button size="mini" type="danger" @click="deleteHandler(scope.row)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <div class="block repeat-menu-page">
                        <el-pagination  background
                        :current-page="page.currentPage"
                        :page-sizes="page.pageSizes"
                        :page-size="page.pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="page.total"
                        @size-change="sizeChangeHandler"
                        @current-change="currentChangeHandler"></el-pagination>
                </div>
            </template>
            <!--删除的提示信息-->
            <el-dialog title="提示信息" :visible.sync="confirmVisible" width="30%"  custom-class="api-dialog-tips" v-cloak>
                <span>此操作将永久删除该记录，是否继续？</span>
                <span slot="footer" class="dialog-footer">
                    <el-button size="mini" @click="cancelHandler">取 消</el-button>
                    <el-button type="primary" @click="executeDelete" size="mini">确 定</el-button>
                </span>
            </el-dialog>
        </aside>
    </section>
</body>
</html>
<script src="/public/js/main.js"> </script>
<script src="/public/js/classManage.js"></script>